home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Genie / Projects / Pedestal / Source / Sources / Views / PedViewSub.cc < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-24  |  1.8 KB  |  132 lines

  1. /*    =============
  2.  *    PedViewSub.cc
  3.  *    =============
  4.  */
  5.  
  6. #include "PedestalDebugging.h"
  7.  
  8. #include <Windows.h>
  9.  
  10. #include "PedViewSub.hh"
  11. #include "PedPaneSubView.hh"
  12.  
  13. PedViewSub::PedViewSub(PedPaneSubView &inSuperPane)
  14. : mSuperPane(inSuperPane)
  15. {
  16.     mOrigin.h = mOrigin.v = 0;
  17.     mSuperPane.GetBounds(mFrame);
  18. }
  19.  
  20. PedViewSub::~PedViewSub()
  21. {
  22. }
  23.  
  24. PedPaneSubView &
  25. PedViewSub::SuperPane()
  26. {
  27.     return mSuperPane;
  28. }
  29.  
  30. void
  31. PedViewSub::GetFrame(Rect &outFrame)
  32. {
  33.     Rect bounds;
  34.     
  35.     mSuperPane.GetBounds(bounds);
  36.     ::SetRect(&outFrame, 
  37.         0, 0, bounds.right - bounds.left, bounds.bottom - bounds.top);
  38. }
  39.  
  40. void
  41. PedViewSub::GetOrigin(Point &outOrigin)
  42. {
  43.     outOrigin = mOrigin;
  44. }
  45.  
  46. void
  47. PedViewSub::SetOrigin(Point inOrigin)
  48. {
  49.     mOrigin = inOrigin;
  50. }
  51.  
  52. PedWindow &
  53. PedViewSub::Window()
  54. {
  55.     return SuperPane().SuperView().Window();
  56. }
  57.  
  58. void
  59. PedViewSub::GetWindowToFrameOffset(Point &outOffset)
  60. {
  61.     SuperPane().SuperView().GetWindowToLocalOffset(outOffset);
  62.     
  63.     Rect bounds;
  64.     SuperPane().GetBounds(bounds);
  65.     //::AddPt(bounds.topLeft, &outOffset);
  66.     outOffset.h += bounds.left;
  67.     outOffset.v += bounds.top;
  68. }
  69.  
  70. void
  71. PedViewSub::Focus()
  72. {
  73.     SuperPane().SuperView().Focus();
  74. }
  75.  
  76. void
  77. PedViewSub::Open()
  78. {
  79. }
  80.  
  81. void
  82. PedViewSub::Close()
  83. {
  84. }
  85.  
  86. void
  87. PedViewSub::Activate()
  88. {
  89. }
  90.  
  91. void
  92. PedViewSub::Deactivate()
  93. {
  94. }
  95.  
  96. void
  97. PedViewSub::Refresh()
  98. {
  99.     Rect invalid;
  100.     Point offset;
  101.     
  102.     GetFrame(invalid);
  103.     GetWindowToFrameOffset(offset);
  104.     ::OffsetRect(&invalid, offset.h, offset.v);
  105.     ::InvalRect(&invalid);
  106. }
  107.  
  108. void
  109. PedViewSub::Resize(short inWidth, short inHeight)
  110. {
  111.     PedView::Resize(inWidth, inHeight);
  112.     mFrame.right = mFrame.left + inWidth;
  113.     mFrame.bottom = mFrame.top + inHeight;
  114. }
  115.  
  116.  
  117. void
  118. PedViewSub::DispatchNullEvent(EventRecord &inEvent)
  119. {
  120.     
  121. }
  122.  
  123. void
  124. PedViewSub::DispatchClickEvent(EventRecord &inEvent)
  125. {
  126. }
  127.  
  128. void
  129. PedViewSub::DispatchKey(EventRecord &inEvent)
  130. {
  131. }
  132.